<?php
FLEA::loadClass('Controller_Base');

class Controller_Manager extends Controller_Base
{

	function actionGetOrderFirms()
	{
		$_modelFirm	=&	FLEA::getSingleton('Model_Firm');

		$inventionFirms	=	$_modelFirm->findAllInventionFirms();
		$trademarkFirms	=	$_modelFirm->findAllTradeMarkFirms();
		$copyrightFirms	=	$_modelFirm->findAllCopyrightFirms();

		print '<firms>';
		$this->purse($inventionFirms,'inventionfirms',0);
		$this->purse($trademarkFirms,'trademarkFirms',0);
		$this->purse($copyrightFirms,'copyrightFirms',0);
		print '</firms>';
	}
	
	function actionUpdateService()
	{
		
		$_modelUser	=&	FLEA::getSingleton('Model_User');
		
		$userID		=	$_POST['UserID'];
		$userID		=	$userID==''?0:$userID;
		
		$user 		=	$_modelUser->findByField('UserID',$userID);
		
		$user['BService']	=	$user['BService']==0?1:0;
		
		$result		=	$_modelUser->save($user);
		$this->showResult($result);
	}
}